﻿<UserControl x:Class="personalplaner.gui.stamm.views.PersonaAbteilungView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:data="clr-namespace:personalplaner.business.stamm;assembly=personalplaner.business"
             xmlns:conv="clr-namespace:personalplaner.common.converters;assembly=personalplaner.common"
             xmlns:c="clr-namespace:personalplaner.common.controls;assembly=personalplaner.common"
             xmlns:p="clr-namespace:personalplaner.gui.Properties" mc:Ignorable="d" >

    <Border BorderBrush="Transparent" BorderThickness="1" Background="Transparent" Padding="5">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <TextBlock Text="Von" Grid.Column="0" Grid.Row="0" Margin="1,1,10,1"/>
                <DatePicker Grid.Column="1" Grid.Row="0" SelectedDate="{Binding PersonAbteilungModel.Von}"/>
                <Image Source="/personalplaner.gui;component/resources/images/Info.png" Grid.Column="2" Grid.Row="0" Margin="0,0,50,0" Height="16">
                    <Image.ToolTip>
                        <StackPanel>
                            <TextBlock Text="Das Arbeitspensum kann nur auf anfangs Monat gesetzt werden. Das Datum wird automatisch auf anfang Monat gesetzt." TextWrapping="Wrap"/>
                        </StackPanel>
                    </Image.ToolTip>
                </Image>
                <TextBlock Text="Pensum Unverteilt" Grid.Column="3" Grid.Row="0" Margin="1,1,10,1"/>
                <TextBox Grid.Column="4" Grid.Row="0" IsEnabled="False" Text="{Binding PersonAbteilungModel.MaxPensum}"/>


                <TextBlock Text="Bis" Grid.Column="0" Grid.Row="1" Margin="1,1,10,1"/>
                <DatePicker Grid.Column="1" Grid.Row="1" SelectedDate="{Binding PersonAbteilungModel.Bis}"/>
                <Image Source="/personalplaner.gui;component/resources/images/Info.png" Grid.Column="2" Grid.Row="1" Margin="0,0,50,0" Height="16">
                    <Image.ToolTip>
                        <StackPanel>
                            <TextBlock Text="Das Arbeitspensum- Ende kann nur auf ende Monat gesetzt werden. Das Datum wird automatisch auf ende Monat gesetzt." TextWrapping="Wrap"/>
                        </StackPanel>
                    </Image.ToolTip>
                </Image>
                <TextBlock Text="Pensum pro Team" Grid.Column="3" Grid.Row="1" Margin="1,1,10,1"/>
                <c:NumericTextBox Grid.Column="4" Grid.Row="1" DataContext="{Binding PersonAbteilungModel}" Text="{FocusBinding Path=Pensum}"/>
            </Grid>

            <Grid Grid.Row="1" Margin="0,10,0,0">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <TextBlock Text="Nicht zugewiesen" FontSize="14" FontWeight="Thin" Margin="0,10,0,5"/>
                <TextBlock Text="Zugewiesen" Grid.Column="2" FontSize="14" FontWeight="Thin" Margin="0,10,0,5"/>

                <ListBox Grid.Row="1" BorderThickness="0,0,1,0"
                             ItemsSource="{Binding PersonAbteilungModel.AbteilungenNichtZugeteilt}"
                             SelectedItem="{Binding PersonAbteilungModel.SelectedAbteilungNichtZugeteilt}"
                             DisplayMemberPath="Name"/>
                <StackPanel Grid.Row="1" Orientation="Vertical" Grid.Column="1">
                    <Button Style="{StaticResource BoarderedButtonStyle}" Margin="5,0,5,5" Command="{Binding AddToListCommand}">
                        <Image Source="/personalplaner.gui;component/resources/images/Navigation Right.png" Style="{StaticResource ButtonImageStyle}" Height="16" Margin="2"/>
                    </Button>
                    <Button Style="{StaticResource BoarderedButtonStyle}" Margin="5,0,5,5" Command="{Binding RemoveFromListCommand}">
                        <Image Source="/personalplaner.gui;component/resources/images/Navigation Left.png" Style="{StaticResource ButtonImageStyle}" Height="16" Margin="2"/>
                    </Button>
                </StackPanel>
                <ListBox Grid.Column="2" Grid.Row="1" BorderThickness="0,0,1,0"
                             ItemsSource="{Binding PersonAbteilungModel.AbteilungenZugeteilt}"
                             SelectedItem="{Binding PersonAbteilungModel.SelectedAbteilungZugeteilt}"
                             DisplayMemberPath="Name"/>
            </Grid>

            <TextBlock Text="{x:Static p:Resources.PersonAbteilungDescription}" Grid.Row="2" TextWrapping="Wrap" Margin="0,20,0,0"/>
        </Grid>
    </Border>
</UserControl>
